﻿using Base.ModuleBase;
using Prism.Commands;
using Prism.Common;
using Prism.Events;
using Prism.Ioc;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace WPF_Prism_Test.ViewModels
{
    public class MainWindowViewModel : ViewModelBase
    {
        #region 成员

        #endregion

        #region 属性
        private string m_StringValue = string.Empty;
        /// <summary>
        /// 测试值
        /// </summary>
        public string StringValue
        {
            get
            {
                return m_StringValue;
            }
            set
            {
                SetProperty(ref m_StringValue, value);
            }
        }
        #endregion

        #region 构造
        public MainWindowViewModel()
        {

        }
        #endregion

        #region 方法

        #region 重写
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="param"></param>
        public override void Init(object param)
        {
            
        }

        /// <summary>
        /// 绑定命令
        /// </summary>
        /// <param name="cmdCollection"></param>
        public override void BindCommands(CommandBindingCollection cmdCollection)
        {
            base.BindCommands(cmdCollection);
        }

        /// <summary>
        /// 绑定事件
        /// </summary>
        public override void BindEvents()
        {
            base.BindEvents();
        }

        /// <summary>
        /// 拖拽移动(不需要可以去除)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void PreviewDragOver(object sender, DragEventArgs e)
        {
            base.PreviewDragOver(sender, e);
        }

        /// <summary>
        /// 拖拽放下(不需要可以去除)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void Drop(object sender, DragEventArgs e)
        {
            base.Drop(sender, e);
        }

        /// <summary>
        /// 登出
        /// </summary>
        /// <param name="args"></param>
        public override void OnLogout(object args)
        {
            base.OnLogout(args);
        }

        #endregion

        #region 命令
        /// <summary>
        /// 测试按钮
        /// </summary>
        public DelegateCommand TempCommand
        {
            get
            {
                return new DelegateCommand(() =>
                {
                    StringValue = "测试";
                });
            }
        } 
        #endregion

        #endregion
    }
}
